package com.benbi.shequapi.bean;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Person {
    private int pid;
    private String password;
    private String civilId;
    private String wxId;
    private String name;
    private String phone;
    private Date birthdate;
    private int gender;
    private Date inDate;

    public Person() {
    }

    public Person(String phone, String password, String name, String civilId, int gender, Date birthdate){
        this.password = password;
        this.phone = phone.isEmpty()?null:phone;
        this.name = name;
        this.civilId = civilId;
        this.gender = gender;
        this.birthdate = birthdate;
    }

    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    public Date getBirthdate() { return birthdate; }

    public void setBirthdate(Date birthdate) { this.birthdate = birthdate; }

    public int getPid() {
        return pid;
    }

    public void setPid(int pid) {
        this.pid = pid;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getCivilId() {
        return civilId;
    }

    public void setCivilId(String civilId) {
        this.civilId = civilId;
    }

    public String getWxId() {
        return wxId;
    }

    public void setWxId(String wxId) {
        this.wxId = wxId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public int getGender() {
        return gender;
    }

    public void setGender(int gender) {
        this.gender = gender;
    }

    @JsonFormat(pattern = "yyyy-MM-dd", timezone="GMT+8")
    @JSONField(format = "yyyy-MM-dd")
    public Date getInDate() {
        return inDate;
    }

    public void setInDate(Date inDate) {
        this.inDate = inDate;
    }
}
